﻿using System.Collections.Generic;
using FixMath;
using UniFramework.Actor;
using UniFramework.Buff;

namespace UniFramework.Battle
{
	/// <summary>
	/// 任何伤害的流转都需要这个数据结构
	/// </summary>
	public class DamageInfo
	{
		public LogicActor attacker; //可以为空
		public LogicActor target; //受伤害者
		public Damage damage;
		public EDamageInfoTag[] tags; //描述当前伤害的类型
		public List<AddBuffInfo> addBuffList = new List<AddBuffInfo>(); //当伤害完成后需要添加的Buff，某些不想马上添加的Buff

		public DamageInfo(LogicActor attacker, LogicActor target, Damage damage, EDamageInfoTag[] tags)
		{
			this.attacker = attacker;
			this.target = target;
			this.damage = damage;
			if (tags != null)
			{
				this.tags = new EDamageInfoTag[tags.Length];
				for (int i = 0; i < tags.Length; i++)
				{
					this.tags[i] = tags[i];
				}
			}
		}

		/// <summary>
		/// 往当前buff中添加BuffInfo
		/// </summary>
		/// <param name="buffInfo"></param>
		public void AddBuffInfo(AddBuffInfo buffInfo)
		{
			this.addBuffList.Add(buffInfo);
		}
	}
}